<?php

function getSidebar($page)
{
	$ci=& get_instance();
	if($page == 'home'):
		$ci->db->where('tb_testimonial.status',2);
		$ci->db->limit(3);
		$ci->db->order_by('tb_testimonial.testi_id','DESC');
		$ci->db->join('tb_member','tb_member.member_id = tb_testimonial.member_id');
		$ci->db->select('tb_member.nama,tb_testimonial.testi_id,tb_testimonial.isi_testi,tb_testimonial.date_added');
		$qr_testi = $ci->db->get('tb_testimonial');
		$data['arr_testi'] = $qr_testi->result_array();
		$ci->load->view('help/sidebar_home',$data);
	elseif($page == 'produk'):
		$qr_brand = $ci->db->get('tb_brand');
		$data['arr_brand'] = $qr_brand->result_array();
		$ci->load->view('help/sidebar_produk',$data);
	elseif($page == 'common'):
		$ci->db->where('tb_testimonial.status',2);
		$ci->db->limit(2);
		$ci->db->order_by('tb_testimonial.testi_id','DESC');
		$ci->db->join('tb_member','tb_member.member_id = tb_testimonial.member_id');
		$ci->db->select('tb_member.nama,tb_testimonial.testi_id,tb_testimonial.isi_testi,tb_testimonial.date_added');
		$qr_testi = $ci->db->get('tb_testimonial');
		$data['arr_testi'] = $qr_testi->result_array();
		$ci->load->view('help/sidebar_home',$data);
	elseif($page == 'produk_slaker'):
		$ci->load->view('help/sidebar_produk_slaker');
	endif;
}

?>